package com.kakarote.examine.constant;


import com.kakarote.core.common.enums.SystemCodeEnum;
import com.kakarote.core.exception.CrmException;

import java.util.Objects;

//修改权限类型0：都不选1：提交申请时，员工不可修改固定审批人2：提交申请时，员工不可删除固定抄送人
public enum ModifyPermissionTypeEnum {

    NEITHER(0),
    EXAMINE_USER(1),
    COPY_USER(2);

    private ModifyPermissionTypeEnum(Integer type) {
        this.type = type;
    }

    private Integer type;

    public Integer getType() {
        return type;
    }

    public static ModifyPermissionTypeEnum valueOf(Integer type) {
        for (ModifyPermissionTypeEnum modifyPermissionTypeEnum : values()) {
            if (Objects.equals(type, modifyPermissionTypeEnum.getType())) {
                return modifyPermissionTypeEnum;
            }
        }
        throw new CrmException(SystemCodeEnum.SYSTEM_NO_VALID);
    }
}
